﻿namespace Sample.HttpAPI.Extensions
{
    public  static class ServiceExtensions
    {
        public static void ConfigureCors(this IServiceCollection services)
        {
            services.AddCors(options =>
            {
                options.AddPolicy("AnyPolicy",
                    builder => builder.AllowAnyOrigin()//允许任何域
                   .AllowAnyMethod()//允许任何方法
                   .AllowAnyHeader());//允许任何头
            });
        }
    }
}
